home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_09_05 / 9n05121a < prev    next >
Text File  |  1990-08-16  |  2KB  |  83 lines

  1.  
  2.         /******************************************************
  3.         *
  4.         *        file d:\cips\gpcips.c
  5.         *
  6.         *       Functions: This file contains
  7.         *           get_parameters
  8.         *           show_parameters
  9.         *
  10.         *       Purpose - These functions get image parameters.
  11.         *
  12.         *       External Calls:
  13.         *           rstring.c - read_string
  14.         *           intcvrt.c - get_integer
  15.         *
  16.         *       Modifications:
  17.         *           19 February 1987 - These functions were taken out
  18.         *                of the file ip.c.
  19.         *           28 June 1990 - changed to gpcips and the channel
  20.         *                parameter was removed.
  21.         *
  22.         *******************************************************/
  23.  
  24.  
  25. #include "d:\cips\cips.h"
  26.  
  27.  
  28.  
  29.  
  30. get_parameters(il, ie, ll, le)
  31.         int *il, *ie, *le, *ll;
  32. {
  33.         int choice, not_finished;
  34.  
  35.         not_finished = 1;
  36.         while(not_finished){
  37.            show_parameters(il, ie, ll, le);
  38.            printf("\n\nEnter choice to change (enter 0 for no changes) __\b\b");
  39.            get_integer(&choice);
  40.  
  41.            switch (choice){
  42.               case 0:
  43.                  not_finished = 0;
  44.                  break;
  45.  
  46.               case 1:
  47.                  break;
  48.  
  49.               case 2:
  50.                  printf("\nEnter initial line\n___\b\b\b");
  51.                  get_integer(il);
  52.                  break;
  53.  
  54.               case 3:
  55.                  printf("\nEnter initial element\n___\b\b\b");
  56.                  get_integer(ie);
  57.                  break;
  58.  
  59.               case 4:
  60.                  printf("\nEnter last line\n___\b\b\b");
  61.                  get_integer(ll);
  62.                  break;
  63.  
  64.               case 5:
  65.                  printf("\nEnter last element\n___\b\b\b");
  66.                  get_integer(le);
  67.                  break;
  68.  
  69.            }  /* ends switch choice       */
  70.         }     /* ends while not_finished  */
  71. }             /* ends get_parameters      */
  72.  
  73.  
  74. show_parameters(il, ie, ll, le)
  75.         int *il, *ie, *le, *ll;
  76. {
  77.    printf("\n\nThe image parameters are:");
  78.    printf("\n\t2.      il = %4d", *il);
  79.    printf("\n\t3.      ie = %4d", *ie);
  80.    printf("\n\t4.      ll = %4d", *ll);
  81.    printf("\n\t5.      le = %4d", *le);
  82. }  /* ends show_parameters  */
  83.